<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      color: red;

      border: 2px solid purple;/*非继承属性*/
    }

    .box p {
      /* 很少用 */
      border: inherit;
    }
  </style>
</head>
<body>
  
  <div class="box">
    <p>我是p元素</p>
    <h1>我是h1元素</h1>
  </div>

</body>
</html>